<%@ page language="java" session="true" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<jsp:include page="../common/framework/header.jsp" />
<link href="${pageContext.request.contextPath}/static/plugin/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<style type="text/css">
	select.form-control {
	    height: 32px;
	    padding: 4px 6px;
	    width: 200px!important;
	}
	.bs-bars{padding:0;}
</style>
	<div id="container"
		class="effect aside-float aside-bright mainnav-lg navbar-fixed mainnav-fixed aside-fixed">

		<jsp:include page="../common/framework/topper.jsp" />
		<div class="boxed">
			<%--=======================  页面主体内容  ============================--%>
			<div id="content-container">
				<div class="wrappers">
					<%--=========================  页面标题  ==========================--%>
					<div id="page-title">
						<p class="page-header text-overflow table-header">
							系统设置&nbsp;&nbsp;<small>本页面进行系统设置。详细说明请参考
							<a href="http://confluence.paas.sinopec.com/pages/viewpage.action?pageId=11343322#id-使用手册-_Toc471811859" target="_blank">&lt;使用手册&gt;</a></small>
						</p>
					</div>
					<ol class="breadcrumb">
						<li><a href="#">系统管理</a></li>
						<li class="active">系统设置</li>
					</ol>
					<div id="page-content">
						<div class="panel">
							<div class="panel-body pad-top-no">
								<div id="toolbar">
									<form id="search_form" class="form-inline" autocomplete="off">

										<label class="control-label width-auto" for="appName">配置参数:</label>
										<div class="input-group">
											<input id="appName" name="appName" type="text" placeholder="请输入" class="form-control">
										  	<span class="input-group-btn" onclick="searchForm();">
												<a class="btn btn-icon btn-hover-primary" type="button" style="margin-right: 15px;">
													<i class="fa fa-search" ></i>
												</a>
											</span>
										</div>

										<label class="control-label width-auto" for="appName">值:</label>
										<div class="input-group">
											<input id="appName" name="appName" type="text" placeholder="请输入" class="form-control">
										  	<span class="input-group-btn" onclick="searchForm();">
												<a class="btn btn-icon btn-hover-primary" type="button" style="margin-right: 15px;">
													<i class="fa fa-search" ></i>
												</a>
											</span>
										</div>

										<label class="control-label width-auto" for="appName">描述:</label>
										<div class="input-group">
											<input id="appName" name="appName" type="text" placeholder="请输入" class="form-control">
										  	<span class="input-group-btn" onclick="searchForm();">
												<a class="btn btn-icon btn-hover-primary" type="button" style="margin-right: 15px;">
													<i class="fa fa-search" ></i>
												</a>
											</span>
										</div>

										<a id = "reset" class = "btn btn-gray" style="margin-top: 2px;"><i class="glyphicon glyphicon-share-alt"></i>重置</a>

										<a class="btn btn-primary pull-right" id="insert" style="margin-top: 2px;">
											<i class="fa fa-plus"></i>添加
										</a>

									</form>
								</div>
                                  <table id="sysNumber" class="table" data-single-select="true" data-toolbar="#toolbar"
               						 data-buttons-class="hover-primary">
                                      <thead>
								        <tr>
								            <th data-field="" data-checkbox="true"></th>
								            <th data-field="parameter">配置参数</th>
								            <th data-field="value" >值</th>
								            <th data-field="remark" >描述</th>
								            <th data-align="center" data-width="140" data-formatter="pref_btns">操作</th>
								        </tr>
								    </thead>
                                  </table>
							</div>
						</div>

			</div>
		</div>
	</div>

		<%--=========================  过程可视化消息栏  ==========================--%>
		<jsp:include page="../common/framework/aside.jsp" />

		<%--=========================  左侧菜单  ==========================--%>
		<jsp:include page="../common/framework/lefter.jsp" />

	</div>

	<%--=========================  页面底部版权信息  ==========================--%>
	<jsp:include page="../common/framework/footer.jsp" />
	<%--=========================  选择皮肤功能  ==========================--%>
	<jsp:include page="../common/framework/page-set.jsp" />
</div>
	<div id="floating-top-right" class="floating-container"></div>
<%--===================================================--%>
<%-- END OF CONTAINER --%>

<jsp:include page="../common/framework/script.jsp" />
	<script src="${pageContext.request.contextPath}/static/js/common/bootdatatable.init.js"></script>
	<script src="${pageContext.request.contextPath}/static/plugin/bootstrap-table/bootstrap-table.min.js"></script>
	<script src="${pageContext.request.contextPath}/static/plugin/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>


	<script type="text/javascript">


$(function() {
	//加载表格
	$('#sysNumber').bootdatagrid(
			"${pageContext.request.contextPath}/static/plugin/bootstrap-table/staticData/sysSet.json", {
				pagination : true,
				pageNumber : 1,
				pageSize : 10,
				dataType:'json',
				singleSelect : false,
				striped : true,
				clickToSelect : true
	});

})
function invoiceFormatter(value,row,index){
	return 'ID '+value;
}
function pref_btns(value,row,index){
	var btns = '';
	btns += '<a class="btn-table-cell" onclick="addOrEditConfig('+index+')">编辑</a>';
	return btns;
}

function tablebtnclick(e){
	Alert.success($(e).text());
}

//添加按钮
$("#insert").click(function(){
	var index = -1;

		addOrEditConfig(index);
});
var flag;
var loadFlag;
//添加或编辑资源事件
var width = $(window).width()*0.3;
var height = $(window).height()*0.15;

function addOrEditConfig(index){
	flag = index;

		layer.open({
			type : 2,
			title : (flag != -1) ? '编辑配置信息' : '添加配置信息',
			fix : true,
			scrollbar : false,
			area : [ '500px', '380px' ],
			//offset: [height, width],
			shift : 2,
			content : '${pageContext.request.contextPath}/addOrEditConfig',
			btn: ['确定', '取消'],
				yes : function(index, layer) {
		            var iframeWin = layer.find('iframe')[0];
		            iframeWin.contentWindow.submit();
		        },
		        btn2:function(index, layer) {
// 		        	var iframeWin = layer.find('iframe')[0];
// 	            iframeWin.contentWindow.closeLayer();
		        },
			end : function(){
				 if(loadFlag == 0)
					reLoad('configuration','../configMessage/queryConfigMessageList.do', getRefreshParam());
			}
		});
};
</script>
</body>
</html>

